﻿namespace Sidvall.Office
{
	public class WorksheetShape : IWorksheetShape
	{
		#region Public Members

		#region BottomRightCornerCell

		public WorksheetCell BottomRightCornerCell
		{
			get
			{
				if (this.InternalWorksheetShape.BottomRightCornerCell == null)
					return null;
				return new WorksheetCell(this.InternalWorksheetShape.BottomRightCornerCell);
			}
			set
			{
				if (value != null)
					this.InternalWorksheetShape.BottomRightCornerCell = value.InternalWorksheetCell;
			}
		}

		#endregion
		#region TopLeftCornerCell

		public WorksheetCell TopLeftCornerCell
		{
			get
			{
				if (this.InternalWorksheetShape.TopLeftCornerCell == null)
					return null;
				return new WorksheetCell(this.InternalWorksheetShape.TopLeftCornerCell);
			}
			set
			{
				if (value != null)
					this.InternalWorksheetShape.TopLeftCornerCell = value.InternalWorksheetCell;
			}
		}

		#endregion
		#region Visible

		public bool Visible
		{
			get
			{
				return this.InternalWorksheetShape.Visible;
			}
			set
			{
				this.InternalWorksheetShape.Visible = value;
			}
		}

		#endregion

		#region ToString

		public override string ToString()
		{
			return "WorksheetShape - Sidvall.Office.IG";
		}

		#endregion

		#region IWorksheetShape Members

		IWorksheetCell IWorksheetShape.BottomRightCornerCell
		{
			get
			{
				return this.BottomRightCornerCell;
			}
			set
			{
				this.BottomRightCornerCell = value as WorksheetCell;
			}
		}
		IWorksheetCell IWorksheetShape.TopLeftCornerCell
		{
			get
			{
				return this.TopLeftCornerCell;
			}
			set
			{
				this.TopLeftCornerCell = value as WorksheetCell;
			}
		}

		#endregion

		#endregion
		#region Private Members

		internal Infragistics.Documents.Excel.WorksheetShape InternalWorksheetShape { get; set; }

		#endregion
		#region Constructors

		public WorksheetShape(Infragistics.Documents.Excel.WorksheetShape worksheetShape)
		{
			this.InternalWorksheetShape = worksheetShape;
		}

		#endregion
	}
}
